<?php

namespace app\model;

use think\Model;

class CustomerGroups extends Model
{
    // Define the table name
    protected $name = 'customer_groups';
    public $timestamps = false;

    // 定义关联
    public function descriptions()
    {
        // 需要额外加条件
        return $this->hasMany(CustomerGroupDescriptions::class, 'customer_group_id', 'id')->where('locale', 'zh_cn');
    }
    
     public function description()
    {
        return $this->hasOne(CustomerGroupDescriptions::class, 'customer_group_id', 'id')->where('locale','zh_cn');
    }



}
